Optimal. Leaf size=65 \[ \frac{a \cos (c+d x)}{d}+\frac{3 a \tan (c+d x)}{2 d}+\frac{a \sec (c+d x)}{d}-\frac{a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{3 a x}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.102326, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.28, Rules used = {2838, 2590, 14, 2591, 288, 321, 203} \[ \frac{a \cos (c+d x)}{d}+\frac{3 a \tan (c+d x)}{2 d}+\frac{a \sec (c+d x)}{d}-\frac{a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{3 a x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2838
Rule 2590
Rule 14
Rule 2591
Rule 288
Rule 321
Rule 203
Rubi steps
\begin{align*} \int \sin (c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx &=a \int \sin (c+d x) \tan ^2(c+d x) \, dx+a \int \sin ^2(c+d x) \tan ^2(c+d x) \, dx\\ &=-\frac{a \operatorname{Subst}\left (\int \frac{1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}+\frac{a \operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac{a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{a \operatorname{Subst}\left (\int \left (-1+\frac{1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}+\frac{(3 a) \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{3 a \tan (c+d x)}{2 d}-\frac{a \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{(3 a) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac{3 a x}{2}+\frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{3 a \tan (c+d x)}{2 d}-\frac{a \sin ^2(c+d x) \tan (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.102209, size = 63, normalized size = 0.97 \[ -\frac{3 a (c+d x)}{2 d}+\frac{a \sin (2 (c+d x))}{4 d}+\frac{a \cos (c+d x)}{d}+\frac{a \tan (c+d x)}{d}+\frac{a \sec (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.05, size = 94, normalized size = 1.5 \begin{align*}{\frac{1}{d} \left ( a \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{5}}{\cos \left ( dx+c \right ) }}+ \left ( \left ( \sin \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\sin \left ( dx+c \right ) }{2}} \right ) \cos \left ( dx+c \right ) -{\frac{3\,dx}{2}}-{\frac{3\,c}{2}} \right ) +a \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{\cos \left ( dx+c \right ) }}+ \left ( 2+ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \right ) \cos \left ( dx+c \right ) \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.55021, size = 84, normalized size = 1.29 \begin{align*} -\frac{{\left (3 \, d x + 3 \, c - \frac{\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a - 2 \, a{\left (\frac{1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.0835, size = 263, normalized size = 4.05 \begin{align*} \frac{a \cos \left (d x + c\right )^{3} - 3 \, a d x + 2 \, a \cos \left (d x + c\right )^{2} - 3 \,{\left (a d x - a\right )} \cos \left (d x + c\right ) +{\left (3 \, a d x + a \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) + 2 \, a\right )} \sin \left (d x + c\right ) + 2 \, a}{2 \,{\left (d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28156, size = 122, normalized size = 1.88 \begin{align*} -\frac{3 \,{\left (d x + c\right )} a + \frac{4 \, a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1} + \frac{2 \,{\left (a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, a\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]